package com.wing.product.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wing.mybatis.common.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Schema(description="生产加工订单表")
@Data
@EqualsAndHashCode(callSuper=true)
@TableName(value = "warehouse_production_order")
public class WarehouseProductionOrder extends BaseEntity<WarehouseProductionOrder> {

    @TableField(value = "production_order_number")
    @Schema(description="生产加工订单编号")
    private String productionOrderNumber;

    @TableField(value = "source")
    @Schema(description="数据来源(1.会员端，2.后台端)")
    private String source;

    @TableField(value = "customer_id")
    @Schema(description="客户id")
    private Long customerId;

    @TableField(value = "customer_name")
    @Schema(description="客户名称")
    private String customerName;

    @TableField(value = "customer_code")
    @Schema(description="客户编码")
    private String customerCode;

    @TableField(value = "contract_id")
    @Schema(description="合同id")
    private Long contractId;

    @TableField(value = "contract_code")
    @Schema(description="合同编号")
    private String contractCode;

    @TableField(value = "total_weight")
    @Schema(description="总重量")
    private BigDecimal totalWeight;

    @TableField(value = "total_processing_fee")
    @Schema(description="总加工费")
    private BigDecimal totalProcessingFee;

    @TableField(value = "status")
    @Schema(description="状态1.待受理，2.已受理，3.已排产，4.加工中，5.运输中，6.完成")
    private String status;

    @TableField(value = "storage_time")
    @Schema(description="入库时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime storageTime;

    @TableField(value = "owner_order_number")
    @Schema(description="货主订单号")
    @NotBlank(message = "请填写货主订单号")
    private String ownerOrderNumber;

    @TableField(value = "delivery_time")
    @Schema(description="交货时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliveryTime;

    @TableField(value = "material_type")
    @Schema(description="物料种类")
    private String materialType;

    @TableField(value = "remaining_production_schedule")
    @Schema(description="剩余排产数")
    private Integer remainingProductionSchedule;

    @TableField(value = "processed_quantity")
    @Schema(description="总加工产品数")
    private Integer processedQuantity;

    @TableField(value = "processing_report_number")
    @Schema(description="报工数量")
    private Integer processingReportNumber;

    @TableField(value = "quality_testing_qualified_number")
    @Schema(description="质检合格数")
    private Integer qualityTestingQualifiedNumber;

    @TableField(value = "quality_testing_unqualified_number")
    @Schema(description="质检不合格数")
    private Integer qualityTestingUnqualifiedNumber;

    @TableField(value = "finished_product_number")
    @Schema(description="成品入库数")
    private Integer finishedProductNumber;

    @TableField(value = "processing_type")
    @Schema(description="加工类型")
    private Long processingType;

    @TableField(value = "product_brand_id")
    @Schema(description="品牌id")
    private Long productBrandId;

    @TableField(value = "product_producer_id")
    @Schema(description="生产商id")
    private Long productProducerId;

    @TableField(value = "product_variety_id")
    @Schema(description="品种id")
    private Long productVarietyId;

    @TableField(value = "product_mark_id")
    @Schema(description="牌号id")
    private Long productMarkId;

    @TableField(value = "warehouse_product_inventor_id")
    @Schema(description="产品id")
    private Long warehouseProductInventorId;
}
